Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Carl143
Frequent Visitor

Creating a button that makes a choice On Click

Hi 

I have created a PowerApp within a PowerBi dashboard.

It has a "Comment" writeback function to a Sharepoint list 

 

Visual below has the "Invoice Number" (Can be Alpha Numeric) as a row record on the sharepoint list

So it shows up the comments for this record

Carl143_0-1727232891105.png

 

If the row record does not exist on the Sharepoint list nothing shows

Carl143_1-1727233246716.png

 

What i would like to be able to do is when selecting button

Carl143_2-1727233377510.png

 

It works as described below:

 

If Row Record exist then Navigate to Update Form

Else Navigate to Create Record Form

 

Hope someone can help

 

1 ACCEPTED SOLUTION

Hi Ibendlin

 

Thanks for your guidance, 

 

I used the below code to make the switch work -

If(IsBlankOrError(LookUp('ACTION_&_COMMENT_LIST2',ThisItem.ROW_ID="")), Navigate(IssueUpdateForm ),Navigate(CreateRecordForm))
 
The strange thing that i have been struggling with is getting the order of the argument, i thought Navigate(CreateRecordForm should go before Navigate(IssueUpdateForm
 
and using the ROW_ID="" i had been trying to use 0
 
Thanks
Carl

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

What i would like to be able to do is when selecting button

That's not how this works.  You need to select the row, not the button.  When you select the row that selection should then filter the PowerApp visual, and you can fetch that via PowerBI.Integration.

Hi Ibendlin

Just to clarify

1) Yes i select the row which selects the Invoice Number, 

a) If there is no record on my Sharepoint List Comments box is blank, which is the expected result.

b) If there is a record on the Sharepoint list it retrieves the Comment, which is the expected result

 

2) Rather than have 2 buttons,

a) one which takes you to "Update Form" where you can edit the details on the form

b) The other takes you to "Create Form" (Via Patch) to create a new row record

 

I would like to have one button which recognizes if a row record exists or doesnt exist and takes the user to the correct form, "Update Form" or "Create Form"

 

Why have two forms?  how are they different?

I thought thats how you did it, 

When updating a row record use Update Form (to avoid duplication of row records)

When creating a row record use Create From via Patch 

You would make that decision in PowerApp. When you get the single value from Power BI, try to match it to your collection. Show the edit form if you have a match, the create form otherwise. Upon patching use the ID for edit and default for add.

Hi Ibendlin

 

Thanks for your guidance, 

 

I used the below code to make the switch work -

If(IsBlankOrError(LookUp('ACTION_&_COMMENT_LIST2',ThisItem.ROW_ID="")), Navigate(IssueUpdateForm ),Navigate(CreateRecordForm))
 
The strange thing that i have been struggling with is getting the order of the argument, i thought Navigate(CreateRecordForm should go before Navigate(IssueUpdateForm
 
and using the ROW_ID="" i had been trying to use 0
 
Thanks
Carl

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.