cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ashok2
Level: Powered On

Gallery Items Patch

I had created Gallery with check boxes for each item and two buttons to approve and reject , where user select all or few check box and when click on Reject or approve all item who are checked will update approve or reject.

 

On Approve button i have written below condition which will update if its ,"Submit" to  "Completed",
"Completed" to  "Approve" and update ActionDate_1 and ActionDate_2 to current date when action taken  this piece of formula is working  fine,

ForAll(
RenameColumns(Filter(Gallery_1.AllItems,Checkbox3_1.Value),"ID","ID1"),
Patch(
SPLIST,
LookUp(SPLIST,ID=ID1),
{Status:{Value:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", "Completed",
"Completed", "Approve"
)
},
ActionDate_1:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", Today(),
"Completed", LookUp(SPLIST,ID=ID1,ActionDate_1)
),
ActionDate_2:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,"Completed", Today(),
"Approve", LookUp(SPLIST,ID=ID1,ActionDate_2)

)
}
)
)

 

On Reject button i have written below condition which will update if its ,"Submit" to  "RejectFirstLevel", and if it mark "Completed" from approve  condition then it can be RejectSecondLevel however in this Formula my ActionDate_1 will update from Approve  condition but will get disappear if condition is  "Completed", "RejectSecondLevel"

ForAll(
RenameColumns(Filter(Gallery_1.AllItems,Checkbox3_1.Value),"ID","ID1"),
Patch(
SPLIST,
LookUp(SPLIST,ID=ID1),
{Status:{Value:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", "RejectFirstLevel",
"Completed", "RejectSecondLevel"
)
},
ActionDate_1:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", Today(),
"RejectFirstLevel", LookUp(SPLIST,ID=ID1,ActionDate_1)
),
ActionDate_2:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,"Completed", Today(),
"RejectSecondLevel", LookUp(SPLIST,ID=ID1,ActionDate_2)

)
}
)
)

 

Let me know if you need further clarification i tried best to explain logic 

3 REPLIES 3
Ashok2
Level: Powered On

Re: Gallery Items Patch

Any help in this issue ?
Community Support Team
Community Support Team

Re: Gallery Items Patch

Hi @Ashok2 ,

I think you maybe forgot the process of turning "RejectFirstLevel " to  "RejectSecondLevel ".Please try to add this process in the if statement:

ForAll(
RenameColumns(Filter(Gallery_1.AllItems,Checkbox3_1.Value),"ID","ID1"),
Patch(
SPLIST,
LookUp(SPLIST,ID=ID1),
{Status:{Value:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", "RejectFirstLevel",
"Completed", "RejectSecondLevel",
"RejectFirstLevel", "RejectSecondLevel"
)
},
ActionDate_1:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,
"Submit", Today(),
"RejectFirstLevel", LookUp(SPLIST,ID=ID1,ActionDate_1)
),
ActionDate_2:
Switch(
LookUp(SPLIST,ID=ID1).Status.Value,"Completed", Today(),
"RejectFirstLevel", Today(),
"RejectSecondLevel", LookUp(SPLIST,ID=ID1,ActionDate_2)

)
}
)
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashok2
Level: Powered On

Re: Gallery Items Patch

thank @v-yutliu-msft  for reply but  in my solution if it  "RejectFirstLevel" level it will not go to "RejectSecondLevel" however if status is "Completed"  then only RejectSecondLevel can take place . My ActionDate_1 get disappear 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,319)