I am developing a workflow that will read information from a Launcher and should consider only fields with values. The fields in the form correspond to the attributes in Account Schema of a Delimited file source (named PersonalInfoSource) and purpose of the workflow is to let users change some of the values corresponding to their account in the PersonalInfoSource. This source will have one account per identity and based on the user using the launcher their specific account will be updated with the details input in the Launcher form.
What I am trying to do is call “schemas” API for PersonalInfoSource and iterate through each of the attributes to check if the corresponding field from the Launcher has any value input. (Field names in the form match exactly the attribute name). So, I am using the $.hTTPRequest.body[0].attributes as input for the “For loop” where hTTPRequest is the API call made to get the schemas and there is just one schema for the source. I am able to read each attribute name using the path $.loop.loopInput.name, but when I try to read the form data using $.interactiveForm.formData.{{$.loop.loopInput.name}} it does not work returning empty string even when there is a value entered in many of the form fields. Note that I am not seeing any value against $.interactiveForm.formData.{{$.loop.loopInput.name}} NOT even “$.interactiveForm.formData.{{$.loop.loopInput.name}}” which is what we usually see when there is no value available to show.
However, when I tried $.interactiveForm.formData.ActualTechNameOfTheFormField I could see the value that was entered in the form field.
Has anyone tried something similar and been successful? Any help will be appreciated
UPDATE:
Interestingly, with a regular loop I am able to get the values by mapping $.interactiveForm.formData to the context of the loop and using $.loop.context.{{$.loop.loopInput.name}} but this does not work in a For loop
I am using Serial Loop with type “For” here. So there is no context required (and not even the option to select context) as Serial loops have access to all items outside the loop. I tested with $.interactiveForm.formData.ActualTechNameOfTheForm inside the loop to confirm this and it worked.
I think this is a limitation of workflows. I’ve also tried referencing a variable inside a variable and have not had much luck.
It seems when you use a .$ AKA choose variable and try to reference a {{$.variable}} inside of that, it doesn’t resolve. The other alternative is something like this {{$.interactiveForm.formData.{{$.loop.loopInput.name}}}}, but I’ve found that also doesn’t work. I think you’ll need to find another way to approach this altogether.
I’m trying out some other workarounds to see if there is a way around this, will let you all know if I can find something that works.
I tried what @baoussounda suggested and wasn’t succesful with those either. I think there is a hard limitation on referencing variables inside another variable.