Ayuda con solicitud de aprobación en una lista de Sharepoint

MARTIN VALERO Carlota - Contractor 100 Reputation points
2023-10-03T09:32:28.5133333+00:00

Tengo una lista de Microsoft lists en la que durante los 8 primeros días del mes, todos los meses tienen que introducir un valor:

Mes Valor

Enero 89

Febrero 78

Marzo 98

Abril 78

Mayo

  • Me gustaría realizar una solicitud de aprobación para que cuando se añada el nuevo valor, se apruebe o se rechace, y si se rechaza, eliminar ese elemento.

El flujo que he creado es:

  1. Cuando se crea o se modifica un elemento.
  2. Iniciar y esperar una aprobación
  3. Condición: Resultado es igual a Approve.
  4. Si no: actualizar elemento: Valor es igual null.

El problema es que en la acción de actualizar elemento se crea un bucle infinito y manda 10 solicitudes de aprobación cada minuto.

Me gustaría saber como puedo evitar eso.

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2023-10-30T02:47:59.1+00:00

    Hi@MARTIN VALERO Carlota - Contractor

    You also need to add a condition to limit the update of valor2

    @empty(string(triggerOutputs()?['body/Valor2']))

    User's image

    User's image

    Update item 2:

    valor1:outputs('Get_item')?['body/Valor']

    valor2: outputs('Get_item')?['body/Valor1']

    Tendencia:

    We use judgment formulas for each of the three situations, and output empty if the conditions are not met.

    if(and(greater(triggerOutputs()?['body/Valor'],outputs('Get_item')?['body/Valor1']),greater(outputs('Get_item')?['body/Valor1'],outputs('Get_item')?['body/Valor2']),greater(triggerOutputs()?['body/Valor'],outputs('Get_item')?['body/Valor2'])),'Ascending',null)
    
    
    
    if(and(less(outputs('Get_item')?['body/Valor'],outputs('Get_item')?['body/Valor1']),less(outputs('Get_item')?['body/Valor1'],outputs('Get_item')?['body/Valor2']),less(outputs('Get_item')?['body/Valor'],outputs('Get_item')?['body/Valor2'])),'Descending',null)
    
    
    
    if(and(equals(triggerOutputs()?['body/Valor'],outputs('Get_item')?['body/Valor1']),equals(outputs('Get_item')?['body/Valor'],outputs('Get_item')?['body/Valor2'])),'Equal',null)
    
    
    

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng


4 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-10-04T02:48:43.43+00:00

    Hi @MARTIN VALERO Carlota - Contractor,

    This is because the record you updated below caused the trigger to be fired repeatedly [when creating or modifying].

    It is recommended that you use Trigger condition to set trigger conditions to limit cycle triggering.

    You can set the flow not to be triggered when a certain one is modified to null.

    User's image

    For example: I hope it will not trigger when the Title column is empty. Then I need to set the trigger condition to false. Then the formula in the trigger condition should be written like this:

    @not(empty(triggerOutputs()?['body/Title']))
    
    
    

    User's image

    Regarding the use of trigger conditions, it is recommended that you refer to this document (the use of trigger conditions can better control the triggering of flow, which is often used in the process of building flow, you can refer to it to learn):

    https://www.bing.com/search?q=power+automate+trigger+conditions&qs=CT&pq=power+automate+trig&sc=10-19&cvid=04E7E2B728454F3EBC928BDD96BF8CCD&FORM=QBRE&sp=1&ghc=1&lq=0


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng

    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2023-10-20T06:38:26.85+00:00

    Hi @MARTIN VALERO Carlota - Contractor

    Here is list:User's image

    User's image

    Here is flow:

    User's image

    Setting:@not(empty(string(triggerOutputs()?['body/ValorActual'])))

    User's image

    User's image

    User's image

    Here is test result:

    Moditify ValorActual value :

    User's image

    Reject:

    User's image

    User's image

    User's image

    User's image

    User's image

    Approve:

    Create new item: Title :4 ValorActual:13

    User's image

    User's image

    User's image

    I won’t keep receiving emails from now on

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng


  4. Anonymous
    2023-10-25T05:29:50.83+00:00

    Hi @MARTIN VALERO Carlota - Contractor

    Please understand that I am not a power automate expert, this forum is dedicated to sharepoint.

    After many tests, I finally implemented a flow that meets your needs.

    I tested and then modified the flow to merge your two requirements into one flow, please try

    Here is a test for your reference:

    Here is list:

    User's image

    Here is flow:

    Setting

    User's image

    Flow:

    User's image

    User's image

    Here is result:

    valor:18

    User's image

    Approve:

    User's image

    User's image

    valor :19

    User's image

    reject:

    User's image

    User's image

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards

    Cheng Feng


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.