cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marsyazahid72
Helper I
Helper I

Cannot return multiple value into SharePoint list after nested condition using power automate.

Hello!

Currently, I am working on points calculation where if the user inputs some variable based on the reference list below through Power Apps connected with SharePoint list, there will be an updated value in the assigned points column.

 

Here the reference list that required few nested conditions that return different values such as below;

Referring to the image below, I have tried to use the "condition" action;

1.png2.JPG

The above condition able to execute successfully but I have difficulty displaying different output with a different condition?

 

Anyone who can help me to solve this problem? Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-yiwenxie-msft
Microsoft
Microsoft

Hi @marsyazahid72 

 

For your first question:

Do you mean you want to use the actions in flow to replace SubmitForm and UpdateIf in Power Apps?

If yes, could you tell me the detailed scenario of how the flow will be triggered? Because from your first screenshot, you have used the ‘When an item is created or modified’ trigger. May I assume you want to use this trigger?

If no, then I’m afraid you’ll need to post the question relating to Power Apps in the Power Apps forum:

Power Apps Community - Power Platform Community (microsoft.com)

 

For your second question:

My ‘Compose’ is just an example for ‘Club’ and ‘Society’. And it’s not for dynamic content. Sorry for this confusion.

 

But I think the action ‘Switch’ suits your need here, so could you please try to use ‘Switch’?

For more info about ‘Switch’: Schema reference for trigger and action types - Azure Logic Apps | Microsoft Docs

 

And I’ve update my flow using the trigger ‘When an item is created or modified’:

 

In my test, I’ve just used Points of reference for Clubs/Society/RCSU. But the same logic applies to Points of reference for the others.

The flow is for your reference:

3.10-10.PNG

Please make sure the dynamic content ‘EC_PA_Cri’ used in all these ‘Conditions’ are from ‘When an item is created or modified’.

 

The detailed step of ‘Switch’:

I only create 2 cases for ‘President’ and ‘Vice president’.

3.10-11.PNG

Please make sure the dynamic content ‘ID’ in all the steps of ‘Update item’ are from ‘When an item is created or modified’.

 

The detailed steps for ‘Switch 2’ are almost the same as those for ‘Switch’ except that the ‘EC_PA_Points’ manually input are different.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
marsyazahid72
Helper I
Helper I

Here the reference list that required few nested conditions that return different values;

refer.JPG

v-yiwenxie-msft
Microsoft
Microsoft

Hi @marsyazahid72 

 

It seems like the action ‘Switch’ better suits your case.

I’ve made a test flow and run it successfully.

 

The list before the flow runs:

3.2-9.PNG

 

The list after the flow runs:

3.2-10.PNG

 

The whole flow is for your reference:

3.2-11.PNG

 

The detailed step for ‘Get item’:

3.2-12.PNG

The filter query is:

EC_PA_Cri eq 'RCSU'

 

‘EC_PA_Cri’ here should be the column field name, and not the display name of the column. You can find the column field name in URL of the column:

3.2-13.PNG

For more info about Filter Query:

OData comparison operator reference - Azure Cognitive Search | Microsoft Docs

 

The detailed steps for ‘Apply to each’:

3.2-14.PNG

3.2-15.PNG

 

The detailed steps for ‘Compose’ and ‘Get items 2’:

3.2-16.PNG

The expression used in ‘Compose’:

union(array('Clubs'),array('Society'))

 

For more info about the functions union() and array():

Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

Reference guide for functions in expressions - Azure Logic Apps | Microsoft Docs

 

The dynamic content ‘Current item’ in ‘Filter Query’ comes from ‘Apply to each 2’.

 

The detailed steps for ‘Apply to each 3’:

3.2-17.PNG

 

If the problem still exists, please feel free to let me know.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiwenxie-msft !🤗

Thanks for your detailed response however, I have some inquiries that need your help to clarify. 

1. In my findings, manually triggered flow is working for the mobile triggers. However, my project is using Form, SubmitForm and UpdateIf Gallery in Power Apps. Fyi, the flow to calculate the EC_PA_Points is triggered when the user clicks the button SubmitForm and UpdateIf Gallery. May I know if there is another suitable technique that is possible to apply to my project?  

2.  So far from my readings, the Union function should get all the items in the collection [eg: array ('Clubs'), array('Society')] which it is an array. So my question is how does it work in the "compose" step. For example, how does the "compose" process the data because the variables might not be the same in each case?

Highly appreciate your time and cooperation. Thank you in advance!🤗
 

v-yiwenxie-msft
Microsoft
Microsoft

Hi @marsyazahid72 

 

For your first question:

Do you mean you want to use the actions in flow to replace SubmitForm and UpdateIf in Power Apps?

If yes, could you tell me the detailed scenario of how the flow will be triggered? Because from your first screenshot, you have used the ‘When an item is created or modified’ trigger. May I assume you want to use this trigger?

If no, then I’m afraid you’ll need to post the question relating to Power Apps in the Power Apps forum:

Power Apps Community - Power Platform Community (microsoft.com)

 

For your second question:

My ‘Compose’ is just an example for ‘Club’ and ‘Society’. And it’s not for dynamic content. Sorry for this confusion.

 

But I think the action ‘Switch’ suits your need here, so could you please try to use ‘Switch’?

For more info about ‘Switch’: Schema reference for trigger and action types - Azure Logic Apps | Microsoft Docs

 

And I’ve update my flow using the trigger ‘When an item is created or modified’:

 

In my test, I’ve just used Points of reference for Clubs/Society/RCSU. But the same logic applies to Points of reference for the others.

The flow is for your reference:

3.10-10.PNG

Please make sure the dynamic content ‘EC_PA_Cri’ used in all these ‘Conditions’ are from ‘When an item is created or modified’.

 

The detailed step of ‘Switch’:

I only create 2 cases for ‘President’ and ‘Vice president’.

3.10-11.PNG

Please make sure the dynamic content ‘ID’ in all the steps of ‘Update item’ are from ‘When an item is created or modified’.

 

The detailed steps for ‘Switch 2’ are almost the same as those for ‘Switch’ except that the ‘EC_PA_Points’ manually input are different.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Yes true that I am using SubmitForm and UpdateIf.
Plus, highly appreciate your suggestion for a Switch case which suits my requirements.

A big thanks again @v-yiwenxie-msft for your amazing help!🤗

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,677)