Hi,
I am trying to build an app where i have added Approve button in the form screen. I have used patch function to update the field values as below. What is the condition is: If the Item is 'Complex' then do 1,2,3 actions else do 4,5,6.
Set(
VarIntake,
If(
DataCardValue73.Selected.Value = "Complex",
Patch(
'List Name',
VarIntake,
{
Status: {Value: "Next Review"},
IntakeReviewComment: intComments.Text
}
),
Patch(
'List Name',
VarIntake,
{
Status: {Value: "Approved"},
IntakeReviewComment: intComments.Text
}
)
)
)
I am able to perform the single action if a specific condition is true, however I want more 2 actions in each condition as below.
If( Type = "Complex",
1. Patch {Staus: ABC},
2. Send Email to Person A
3. Send Email to Person B,
Else,
4. Patch {Status: EFG}
5. Send Email to Person C
6. Send Email to Person D
)
I tried segregating the 1, 2, 3 using &&, ||, ;;, ;, but somehow getting error. Can anyone please help how to combine multiple actions in true and false conditions?
Thanks,
Solved! Go to Solution.
I don't believe there is any way to embed multiple statements inside an If() statement. The only way to do what you are asking is to have a set of If() statements with one for each set of actions.
If( Type = "Complex",
1. Patch {Staus: ABC},
Else,
4. Patch {Status: EFG}
) ;
If( Type = "Complex",
2. Send Email to Person A
Else,
5. Send Email to Person C
) ;
If( Type = "Complex",
3. Send Email to Person B,
Else,
6. Send Email to Person D
)
Hi @AkshayManke ,
below the Code For your requirement.
If(ThisItem.Complexity.Value="Simple",Patch(
TestAkshay,{
ID:ThisItem.ID,
Status:{
Value:"Approved",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
);Office365Outlook.SendEmailV2(ThisItem.'Created By'.Email,"Your Request is Apptoved","Hi your request is approved",{Importance:"High"}),Patch(
TestAkshay,{
ID:ThisItem.ID,
Status:{
Value:"Under Review",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
);Office365Outlook.SendEmailV2(ThisItem.'Created By'.Email,"Your Request is Under Review","Hi your request is approved",{Importance:"High"}))
Thanks,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
I don't believe there is any way to embed multiple statements inside an If() statement. The only way to do what you are asking is to have a set of If() statements with one for each set of actions.
If( Type = "Complex",
1. Patch {Staus: ABC},
Else,
4. Patch {Status: EFG}
) ;
If( Type = "Complex",
2. Send Email to Person A
Else,
5. Send Email to Person C
) ;
If( Type = "Complex",
3. Send Email to Person B,
Else,
6. Send Email to Person D
)
Hi @AkshayManke ,
You can perform multiple actions
If(ThisItem.ID=1,UpdateContext({ValueNew:!ValueNew});Notify("Value is "&ValueNew,NotificationType.Success),Notify("Some Error",NotificationType.Error))
like below using if condition.
just Use ";" for Actions.
Thanks
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi Vijay, @VijayTailor,
I tried using the below but the formula is giving error. Can you please let me know where i am wrong?
Regards,
Akshay
But i need both the actions based on the condition. Fore clarity i have added the blow snap. In the input text field i need Big/Small to be written and also i need the notification in the screen, hence as suggested by you i have added a semicolon ";" after each action in true and false. Is this correct?
Hi @AkshayManke
please have a look into the below URL, Hope that is fit for your requirement and resolve your issue
https://drive.google.com/file/d/1Oi9hnXS7h4Y2EVQZxuuyPiqlosyWV9-m/view
For reference also attached the App.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi Vijay, @VijayTailor
This is exactly what i want. But could you please share the code as well so that i can refer it?
Regards,
Already attached the Full App that I implemented for testing.
See the yellow highlighted.
Thanks
Sorry missed it. I downloaded the app and tried the formula it is working in your application however it is not working in my env. Don't know why. I tried with various combinations. Trying it again and will get back to you with the result shortly.
Thanks and Regards,
Akshay
User | Count |
---|---|
126 | |
87 | |
85 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |