cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamesM
Level 8

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

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

5 REPLIES 5
JamesM
Level 8

Re: Formatting/manipulation on series data or labels on Chart that results from custom connector JSO

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
Level 8

Re: Formatting/manipulation on series data or labels on Chart that results from custom connector JSO

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
Level 8

Re: Formatting/manipulation on series data or labels on Chart that results from custom connector JSO

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?

 

Community Support Team
Community Support Team

Re: Formatting/manipulation on series data or labels on Chart that results from custom connector JSO

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

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
JamesM
Level 8

Re: Formatting/manipulation on series data or labels on Chart that results from custom connector JSO

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 🙂 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 247 members 5,352 guests
Please welcome our newest community members: