Hello,
I've built a flow which is triggered by a form. On the form I collect property type (House) and number of bedrooms (5) and create an item on a sharepoint list
I then concat those answers together to get House5
I would like to use House5 as part of the expression below to retrieve a value from another sharepoint list
outputs('Get_item')?['body/House5']
And so if the form answers were Flat and 2 the resulting expression would then read as -
outputs('Get_item')?['body/Flat2']
I then want to retrieve that value.
Many thanks for any help.
Solved! Go to Solution.
Ok Understood. Reason your compose isn't working because its not an expression. Its a plain text.
This is definitely not straight forward since you would like to make it dynamic. Best Option is to leverage REST APIs where you can manipulate string payload and write that in select clause.
There is one other option possible using Get Items. See below if it can be of help ..
Below is my expression for item...
item()?[ variables('DyamicColumn')]
Many thanks for your support with this issue.
I tried to adopt your suggestion above using the SELECT function but I wasn't able to see how it would work in my scenario.
I've managed to sort my issue, albeit probably not in the most eloquent way. I've nested if statements. It looks a mess but does what I need it to do for now.
Thanks again for your help.
if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House6'),outputs('Get_item_LA')?['body/House6'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House5'),outputs('Get_item_LA')?['body/House5'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House4'),outputs('Get_item_LA')?['body/House4'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House3'),outputs('Get_item_LA')?['body/House3'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House2'),outputs('Get_item_LA')?['body/House2'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House1'),outputs('Get_item_LA')?['body/House1'],''))))))
@PrasadAthalye I went back and revisited your suggestion using select and finally figured it out, which has given me a cleaner solution which is more understandable for other users when reviewing the flow.
So for anyone else with a similar issue, this is what I've ended up doing to achieve my desired outcome.
int(first(variables('Get LA Value'))?[outputs('PROPBEDS')])
Many Thanks
You can concat like this using Compose and then use Compose wherever you would like... In the below example, I am concatenating answers from 2 questions. Since your 2nd question is Int, May be you can convert it to string by wrapping it in string ( ) function.
concat(outputs('Get_response_details')?['body/rd7f84d633bd24b01bd831a1128630b83'], outputs('Get_response_details')?['body/submitDate'])
Many thanks, I've actually already achieved that part, sorry if my question was not entirely clear.
I want to use the result of that concatenation in another expression
So if the result was House5, how do I construct and use that as part of another expression like below?
outputs('Get_item_LA')?['body/House5']
I've done the below using compose, this generates the correct coding I need, but I can't seem to execute that to retrieve the value of body/House5?
When I put the two versions side by side, the output of the compose and then the normal link to the house5 field
The compose returns the expression (GREEN), while the normal link returns 75020 (BLUE)
I want the compose to generate the expression and return me 75020 if possible?
Ok Understood. Reason your compose isn't working because its not an expression. Its a plain text.
This is definitely not straight forward since you would like to make it dynamic. Best Option is to leverage REST APIs where you can manipulate string payload and write that in select clause.
There is one other option possible using Get Items. See below if it can be of help ..
Below is my expression for item...
item()?[ variables('DyamicColumn')]
Many thanks for your support with this issue.
I tried to adopt your suggestion above using the SELECT function but I wasn't able to see how it would work in my scenario.
I've managed to sort my issue, albeit probably not in the most eloquent way. I've nested if statements. It looks a mess but does what I need it to do for now.
Thanks again for your help.
if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House6'),outputs('Get_item_LA')?['body/House6'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House5'),outputs('Get_item_LA')?['body/House5'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House4'),outputs('Get_item_LA')?['body/House4'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House3'),outputs('Get_item_LA')?['body/House3'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House2'),outputs('Get_item_LA')?['body/House2'],if(equals(concat(outputs('Get_Property_Type')?['body/PropertyType'],outputs('Get_response_details')?['body/r16485acb4b4c437c966b09aebdc49e3f'],outputs('Get_response_details')?['body/rba5ca66e8c034ef5aa0c6c1743acc957']),'House1'),outputs('Get_item_LA')?['body/House1'],''))))))
@PrasadAthalye I went back and revisited your suggestion using select and finally figured it out, which has given me a cleaner solution which is more understandable for other users when reviewing the flow.
So for anyone else with a similar issue, this is what I've ended up doing to achieve my desired outcome.
int(first(variables('Get LA Value'))?[outputs('PROPBEDS')])
Many Thanks
Great !! Happy that you managed to resolve the issue. Can you please accept the solution for this thread to close it?
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
13 |
User | Count |
---|---|
127 | |
54 | |
38 | |
24 | |
21 |