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 / Formatting/manipulatio...
Power Apps
Unanswered

Formatting/manipulation on series data or labels on Chart that results from custom connector JSON

(0) ShareShare
ReportReport
Posted on by 273

I have a bar chart as below, that is fed from a collection obtained as a JSON array from a Custom Connector. The series labels along the bottom are DateTime values from the data, however the time portion is cut off. The date part is probably not relevent anyway, so is there a way to update this (without changing the custom connector) so that the series label just shows the time portion? And as another example of formatting/manipulation, what if i wanted to round the values for each bar to less decimal places? 

 

CHARTWindow.png

Categories:
I have the same question (0)
  • JamesM Profile Picture
    273 on at

    I tried this, to remove the date part of the datetime value, but it didn't work, it just converts the date to a 'funny' date, e.g. 1970s.

     

    ClearCollect(selectedServerAvgBasketSizeData, InSiteConnector.GetStoreCurrentBasketSize({server:selectedServer, ordercol:"RowInsertDateTime",order:"DESC",rowlimit:336})) ; UpdateIf(selectedServerAvgBasketSizeData, true, {RowInsertDateTime:TimeValue(Text(RowInsertDateTime))})

     

  • JamesM Profile Picture
    273 on at

    Another attempt, again it didn't work - the series labels are now just blank..

     

    UpdateIf(selectedServerAvgBasketSizeData, true, {RowInsertDateTime:(TimeValue(Text(RowInsertDateTime,"[$-en-US]hh:mm:")))})

    What I was trying to do

     

    - For the whole RowInsertDateTime column (a DateTime value) convert it to text in the format of hh:mm, then convert it back to a Time value so that it will be suitable for the column.

  • JamesM Profile Picture
    273 on at

    I can do the formatting on a single record no problems;

     

    TimeValue(Text(First(selectedServerAvgBasketSizeData).RowInsertDateTime))

    However, that same formula does not work using isUpdate on the collection column. Any ideas?

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @JamesM,

    Could you please share more details about the selectedServerAvgBasketSizeData collection within your app?

    Where do you put the UpdateIf function?

    Based on the formula you provided, I have made a test on my side, and the function works well. The screenshto as below:6.JPG

     

    7.JPGPlease take a try to type the following formula within the OnVisible property or OnStart property of the first screen of your app:

     

    ClearCollect(selectedServerAvgBasketSizeData, InSiteConnector.GetStoreCurrentBasketSize({server:selectedServer, ordercol:"RowInsertDateTime",order:"DESC",rowlimit:336}));
    UpdateIf(
    selectedServerAvgBasketSizeData,
    true,
    {
    RowInsertDateTime: TimeValue(Text(RowInsertDateTime,"[$-en-US]hh:mm"))
    }
    )

    If the issue still exists, please take a try with the following formual within the OnVisible property or OnStart property of the first screen of your app:

    ClearCollect(selectedServerAvgBasketSizeData, InSiteConnector.GetStoreCurrentBasketSize({server:selectedServer, ordercol:"RowInsertDateTime",order:"DESC",rowlimit:336}));
    ForAll(
    RenameColumns(selectedServerAvgBasketSizeData,"RowInsertDateTime","RowInsertDateTime1"),
    Patch(
    selectedServerAvgBasketSizeData,
    LookUp(selectedServerAvgBasketSizeData,RowInsertDateTime=RowInsertDateTime1),
    {
    RowInsertDateTime:TimeValue(Text(RowInsertDateTime1,"[$-en-US]hh:mm"))
    }
    )
    )

    then check if the issue is solved.

     

    Best regards,

    Kris

     

  • JamesM Profile Picture
    273 on at

    Thank you. Here is an example of the data stored in the AvgBasketSize variable 

     

     

    [
     {
     "ServerName": "P641S001",
     "RowInsertDateTime": "2018-10-10T14:41:41.037",
     "Date": "2018-10-10T00:00:00",
     "AvgBasketAmount": 22.1424,
     "AvgBasketQty": 2
     },
     {
     "ServerName": "P641S001",
     "RowInsertDateTime": "2018-10-10T14:11:35.273",
     "Date": "2018-10-10T00:00:00",
     "AvgBasketAmount": 22.7546,
     "AvgBasketQty": 2
     }
    ]

    I will test your suggestions and let you know 🙂 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard