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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.