Skip to main content

Notifications

Power Automate - General Discussion
Answered

Help with a simple Workflow

(0) ShareShare
ReportReport
Posted on by

Hi!,

I hope can help me.

I have made a simple wokflow, where, when an item is created in a sharepoint, it obtains that item and different conditions are raised with a (Switch), this, to apply an "Adaptive Card" that works as a Chat Bot in Teams.

This works perfect, but, in this "adaptive card" I want to put a direct link so that the person who receives it can open the file.

 

When putting a "Get Attachments" action, this works perfectly as long as there is an attachment, but, in case there is no attachment, the flow ends before sending the "adaptive card". 

I need to know if there is a way that, even if there is no attached file, the flow continues to execute.

 

Thanks you!

Emilealonso_0-1646058559514.png

help.PNG

 
 
 
 
 
Categories:
  • Re: Help with a simple Workflow

     

    I use an Expression "body('Card1')?(['data']?['IDApprovalDecsion']" to update the status of my progress but, It doesn't work since I don't know how to connect not only an apply to each, but also the "Card1" action. If in the expression change "Card1" to "Apply to each 2", the flow works but the status doesn't change.

    help2.PNG

  • Re: Help with a simple Workflow

    Hi @ArchitectMadhan 

    It worked, but the last problem keeps coming up. 

    When I want to extract the url of the attached document, in my "addaptive card" I use the dynamic content "AbsoluteUri" and, when I attach a document, it works perfectly, but when not, the workflow continues to finish before running the addaptive card .

  • Verified answer
    ArchitectMadhan Profile Picture
    ArchitectMadhan 1,518 on at
    Re: Help with a simple Workflow

    Hi @Anonymous ,

    You can get the number of attachments and store it in a variable before the step of Switch Condition check statement. Then the variable value you can make use in the Switch A function block within a if condition. The below link might be useful for you to get the count of attachments from a SharePoint List Item.

    https://powerusers.microsoft.com/t5/Building-Flows/Count-the-number-of-attachments-in-a-SharePoint-list-item/td-p/392752

     

    Please accept it as a solution and give thumbs up, if it works for you.

  • Re: Help with a simple Workflow

    Hi @ArchitectMadhan 

    The value of A comes from a selection option made in sharepoint. For each of the options, we work with different people. What I did was that, for each selection, a different workflow was started at the root of the same approver. That is why A, B and C will be independent in each Switch declaration. 

     

    According to what it indicates about the attachments, it is what I am missing, since I have applied a Get Attachments but I need to condition that the flow starts even if there is no attachment.

     
     
     
     
     
     
     
     
     
     
     
  • ArchitectMadhan Profile Picture
    ArchitectMadhan 1,518 on at
    Re: Help with a simple Workflow

    Hi @Anonymous ,

    From where the Value A comes from ? why it is in the Switch statement? When there is no attachments How does the Switch Statement knows it? If only the Switch condition is not A then it will not create the Adaptive Card and terminate.

     

    Please accept it as a solution and give thumbs up, if it works for you.

  • Re: Help with a simple Workflow

    Hi @ArchitectMadhan 

    Thanks for your answer. In the switch condition, there is nothing related to the condition because it is optional for those who create the form with attach files. The problem would be when I want to use the "Adaptive card" where, a part of this, is that, by pressing a button on it, this person can download or access the attached document.

    That is why, within the "Switch condition" I have applied different "Equals to". For example, I have 3 options (A, B and C). if the person selects A, you need to extract the attachment, then send the "Adaptive Card" and finally update the item. This works perfectly only if the person attaches a file.

    But I need it to work even if the person doesn't attach a file.

     

    I hope I have expressed myself well. I'll look forward for your answer.

     

    Regards!

  • ArchitectMadhan Profile Picture
    ArchitectMadhan 1,518 on at
    Re: Help with a simple Workflow

    Hi @Anonymous ,

    Please let me know what value you are having in the Switch condition, is it anything related to attachment?, If yes, then before the Switch statement you need set a value for a variable and then the variable value has to be compared in the Switch statement, For Items with attachment you need to have separate steps and for items without attachment you need to have separate steps.

     

    Please accept it as a solution and give thumbs up, if it works for you.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard