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

Doesnt want the approved or rejected requests by the managers to be deleted

Hi Guys,

 

I have a form and in the gallery I have a remove icon which basically triggers a flow which executes a stored procedure and the item is deleted and the deleted item is saved in my Table.(App_Deleted)

 

I want this item to be deleted for the user but it should still be present in the managers record (button)

 

Managers record is a button which stores all the items the current logged in manager has approved or rejected so far. 

 

When i tested as a user and removed an item from gallery, it also gets removed from the managers record too. (I know its happening because the coloum is removed from the table)

 

Can anyone help me understand if there is a way to make this work ?

 

I have deleted history table(JA_App_Deleted), history log(JH_History) and just application table.(JA_APP)..

 

Any help is much appreciated

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Doesnt want the approved or rejected requests by the managers to be deleted

Hi @asdeev,

I have made a response to the same thread that posted within this forum, please check my response within the following thread:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/Want-the-managers-to-see-what-items-the...

 

If you have solved your problem, please go head to click "Accept as Solution" to identify this thread has been solved for other users.

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Community Support Team
Community Support Team

Re: Doesnt want the approved or rejected requests by the managers to be deleted

Hi @asdeev,

Could you please share a screenshot about your flow's configuration?

Do you trigger a flow to delete the item from your '[dbo].[JHA_APP]' SQL table?

Do you save the deleted items into your App_Deleted table? Could you please share a bit more about the data structure of it? Does it has same data structure as your  '[dbo].[JHA_APP]' SQL table.

 

Based on the formula that you provided, if you want this item to be deleted for the user but it should still be present in the managers record (button), I afraid that there is no way to achieve your needs.

If the user deleted the item from your '[dbo].[JHA_APP]' SQL table, the corresponding item would be deleted permanently for the manager in the '[dbo].[JHA_APP]' SQL table.

As an alternative solution, you could consider save the deleted item into a SQL table (App_Deleted table, as you mentioned), which has same data structure as your '[dbo].[JHA_APP]' SQL table.

I assume that the App_Deleted table (you mentioned) has same data structure as your '[dbo].[JHA_APP]' SQL table, I have made a test on my side, please take a try with the following workaround:

  • Within the Pop-up box (mentioned in your Delete2.PNG), modify the formula within the OnSelect property of the "Yes" button to following:
Patch(     /* <-- Add formula start */
      '[dbo].[App_Deleted]',    /* <-- '[dbo].[App_Deleted]' represents the App_Deleted SQL table on your side */
       Defaults('[dbo].[App_Deleted]'),
       Gallery1.Selected
);       /* <- Add formula end */
Remove(
        '[dbo].[JHA_APP]',
        Gallery1.Selected
);
UpdateContext({varShowPopip: false}); 
Refresh('[dbo].[JHA_APP]');
Refresh('[dbo].[App_Deleted]'); /* <-- Add formula here */
  • Modify the formula within the OnSelect property of the "Managers record" button to following:
Set(FilteredWorkOrders, Filter('[dbo].[App_Deleted]', ManagerAlias = UserEmail));
Refresh('[dbo].[App_Deleted]')

 

Best regards,

Kris

 

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

Re: Doesnt want the approved or rejected requests by the managers to be deleted

 Thanks for the response Kris. Appreciate it.

 

 

Do you trigger a flow to delete the item from your '[dbo].[JHA_APP]' SQL table?

 

My flow for deleting a record from table consists of stored procedure.

 

Do you save the deleted items into your App_Deleted table? Yes, I save it y deleted table.

 

Could you please share a bit more about the data structure of it? Does it has same data structure as your  '[dbo].[JHA_APP]' SQL table.

 

Yes it does have same data structure of my JHA_APP table. I have a foreign key (id) in my [deleted] table.

 

 

  • Within the Pop-up box (mentioned in your Delete2.PNG), modify the formula within the OnSelect property of the "Yes" button to following:
Patch(     /* <-- Add formula start */
      '[dbo].[App_Deleted]',    /* <-- '[dbo].[App_Deleted]' represents the App_Deleted SQL table on your side */
       Defaults('[dbo].[App_Deleted]'),
       Gallery1.Selected
);       /* <- Add formula end */  
Remove(
        '[dbo].[JHA_APP]',
        Gallery1.Selected
);
UpdateContext({varShowPopip: false}); 
Refresh('[dbo].[JHA_APP]');
Refresh('[dbo].[App_Deleted]'); /* <-- Add formula here */ -----


  • what do you mean ADD FORMULA HERE

 

 

  • Modify the formula within the OnSelect property of the "Managers record" button to following:
Set(FilteredWorkOrders, Filter('[dbo].[App_Deleted]', ManagerAlias = UserEmail));
Refresh('[dbo].[App_Deleted]')

 

I did exactly how you mentioned but with this logic, managers button (basically managers) are only able to see the deleted records from the [App_Deleted] table. I want managers to see everything they have approved rejected so far both from [JHA_APP] and [APP_Deleted] tables just because if the users decide not to delete their submitted records then the managers should be able to see those too and not just the deleted records.

 

I hope I am making sense.

 

 

 

 

Community Support Team
Community Support Team

Re: Doesnt want the approved or rejected requests by the managers to be deleted

Hi @asdeev,

I have made a response to the same thread that posted within this forum, please check my response within the following thread:

https://powerusers.microsoft.com/t5/Expressions-and-Formulas/Want-the-managers-to-see-what-items-the...

 

If you have solved your problem, please go head to click "Accept as Solution" to identify this thread has been solved for other users.

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