web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Integrating Powerapps ...
Power Apps
Unanswered

Integrating Powerapps in PowerBI - Datatype change

(0) ShareShare
ReportReport
Posted on by 2

Hi,
I am new to Powerapps. I am working on a powerbi report where a Powerapp is integrated inorder to get the inputs from the user and save it to the SQL database. As per the existing logic, a 'product_id' column (Integer) from the powerbi report is used as 'Powerapps data' based on which the Powerapps gets the user comment and stores the data into the database.

The sample for the existing Powerapps code is:
Collect(
'[Comments_source]',
{
id: Blank(),    //this autoincrements as it is identity column in db
product_id: Max(PowerBIIntegration.Data, product_id),  // Code change required
comments: textcolumn.SelectedText.Reason,
username: User().Email,
}
);


But in this scenario there is a change happening for the "product_id" column where it also has to accept the characters. So the source table changed this column datatype from 'int' to 'varchar'. But this change caused an issue with the PowerApps because it requires a code change in order to accept this data as varchar. So this needs a code change in the line where it gets the product_id. The Max function is no more valid because it is running against a varchar column.

Could anyone please help with this.

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous_Mdky ,

     

    Please try this

    vxiaochenmsft_0-1690785974542.png

    vxiaochenmsft_1-1690785997103.png

     

    Best Regards,

    Wearsky

  • Anonymous_Mdky Profile Picture
    2 on at

    Hi @v-xiaochen-msft ,
    Thanks for the swift response.

    But I would need to insert all the values to the SQL database, be it a number or character.
    Initially the product_id column was int type, so the Max function in powerapps was working fine.
    Now when the datatype is changed from int to varchar, the max function throws 'Invalid arguments' error.

    Ultimately the table in the SQL should have all these values in the 'product_id' column like:

    IDProduct_IDComment
    13245674New comment
    2EFGL001Raised issue
    35460012Buyer saved



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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard