cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
cryptosun
Helper I
Helper I

Urgent Help ! Issue with PowerAPPS Comment Submission In PowerBI report Please HELP!!

Dear Experts, I would be grateful for your help.

 

I am facing an issue with the Patch function, I have a use case in which I have a connected a power app in a power bi report

Where the PowerAPP is being used to take the comments, I am using the patch function to fetch the data from power bi to power apps and then I have added a text input column to get the comments.

 

It is working fine, but even if there is a second comment on a specific material no, it is creating another row, what I want is, that once a comment is submitted, and if there is any previous comment it should update it with the recent comment.

 

If there is no comment, then it should save the comment as it is, in the SharePoint list.

 

I have been trying to do it since many days but i have unable to do it.

 

PS: i am using a gallery to show the data and to take the comments.

This is the code i am using to patch the data from PowerBI to Powerapps and then to submit the comments in the Sharepoint list.

Patch(SharepointlistName,{Title:"1", Commentcolumn:TextInput2.Text,MaterialColumn:ThisItem.MATERIALColumn, PLANNER_CD:ThisItem.PLANNER,


MAT_DESC:ThisItem.DESC_EN,BUS_LINE:ThisItem.BUS_LINE});Navigate(Screen2,ScreenTransition.None)

1 REPLY 1
ChrisMendoza
Resident Rockstar
Resident Rockstar

@cryptosun - You should be checking to see if your 'key' exists in your SharePoint list before you patch. It would look somthing like:

If(
    ThisItem.softwareTermId in colSoftwareTermsUpdates.softwareTermId,
    Update(
        colSoftwareTermsUpdates,
        LookUp(
            colSoftwareTermsUpdates,
            softwareTermId = ThisItem.softwareTermId
        ),
        {
            softwareTermId: ThisItem.softwareTermId,
            softwareTermStart: dte_Software_StartDate.SelectedDate,
            softwareTermEnd: dte_Software_EndDate.SelectedDate,
            softwareTermCost: Value(txt_Software_Cost.Text),
            softwareTermSoftwareId: CurrentItem.softwareId
        }
    ),
    Collect(
        colSoftwareTermsUpdates,
        {
            softwareTermId: ThisItem.softwareTermId,
            softwareTermStart: dte_Software_StartDate.SelectedDate,
            softwareTermEnd: dte_Software_EndDate.SelectedDate,
            softwareTermCost: Value(txt_Software_Cost.Text),
            softwareTermSoftwareId: CurrentItem.softwareId
        }
    )
)

*I'm using a collection in the OnChange event. Reza Dorrani explains this technique at Power Apps Editable Table/Gallery like Excel (Tutorial) - YouTube






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors