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

Community site session details

Session Id : g97ZbLBF5J/ZjgKyN21xYR
Power Apps - Microsoft Dataverse
Answered

Difficulty storing data of type Currency in CDS entity

Like (0) ShareShare
ReportReport
Posted on 31 Jan 2020 23:37:15 by 15

Hi there, 

 

I am trying to insert data into a field of type Currency in a CDS Entity from a canvas app and having no luck.  Seems like a simple thing to do but everything I try gives me one of the two following errors:

 

  • Incompatible Type. The 'Amount' column in the data source you're updating expects a 'Currency' type and you're using a 'Text' type.
  • Incompatible Type. The 'Amount' column in the data source you're updating expects a 'Currency' type and you're using a 'Number' type.

The data is being pulled from a table in the Canvas app, and the Amount field in the table is a custom field formatted as [$-en-US]$ #,###.00

 

I am using a collect statement to update the CDS entity as follows:

  • Collect ('Entity Name', {Amount: ItemTotal})  <- this will give me the error saying I am using a "Text" type

I've tried converting it to a number using

  • Collect ('Entity Name', {Amount: Value(ItemTotal,"[$-en-US]$ #,###.00")}) <- error saying I am using "Number" type

Why can't I store a number in a Currency field????  Seems so odd...

 

Any help is appreciated.  

 

I have the same question (0)
  • SeeSide Profile Picture
    15 on 04 Feb 2020 at 16:44:52
    Re: Difficulty storing data of type Currency in CDS entity

    Thanks for your response.  The truth is there must have been something wrong when I was working on this last Friday.  I had tried both of the options you provide and both were throwing the errors.  

     

    Monday, I come back in and bingo they work.  I had left the code with the hard coded price -> Collect(yxyxies,{Price:200}) <- on Friday and it was error, which was driving me nuts as it definitely should have worked. Monday it did.  

     

    Later on Friday, everything completely crashed to the point where I couldn't even open my apps anymore.  

     

    So...  Thanks for your help, I'm glad to see that currency data types are working.

     

    Shaun

  • Verified answer
    v-siky-msft Profile Picture
    on 03 Feb 2020 at 08:13:11
    Re: Difficulty storing data of type Currency in CDS entity

    @SeeSide 

    Could you share more details about how to pull ItemTotal from a table? Could you share the example and screenshots?

    Please ensure the ItemTotal is a number value.

    I made a simple test, and the code can work well.

     

    Collect(yxyxies,{Price:200})

     

    or

     

     

    Collect(yxyxies,{Price:Value(Text("200","[$-en-US]$ #,###.00"))})

     

     

    If this doesn't make sense, please share more information, and the value of ItemTotal.

    Sik

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 752 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 472

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 358 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Loading complete