cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeekAlf_Pro
Resolver I
Resolver I

different behaviour between computer and devices

Hi,

i struggle with a weird behaviour of powerapps.

i've a collection built from the selected item of a combobox

 

 

ClearCollect(
    TwoDistinctValue;
First(Distinct(
        Filter(
            '[dbo].[QSE_DistinctLigneArr]';
            Value(cb_LgArret.Selected.ligne) = Value(ligne)
        );
        Text(SensA)
    )).Result
    ;
First(Distinct(
        Filter(
            '[dbo].[QSE_DistinctLigneArr]';
            Value(cb_LgArret.Selected.ligne) = Value(ligne)
        );
        Text(SensB)
    )).Result
)

 

 

the data are well retrieved : 

2020-10-12 14_09_14-Qualité TD Rouen - Power Apps.png

this collection is displayed in another combobox : 

2020-10-12 14_07_59-Qualité TD Rouen - Power Apps.png

on the powerapps studio on my computer, it works fine as the pictures prove it

but on my devices (iOS or Android) the second comboBox is deadly empty...

Screenshot_20201012-141026_Power Apps.jpg

i think it's a kind of format issue, but i don't manage to solve it.

 

any help would be welcome 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

Finally...

after a moment, the gateway restart and upgrade seems to have a benefic effect !

gateway and combobox

both are working....

 

View solution in original post

11 REPLIES 11
RandyHayes
Super User III
Super User III

@GeekAlf_Pro 

Can you please clarify and answer the following:

1) What is SensA and SensB?

2) What kind of column type is ligne?

3) What is the items property of cb_LgArret?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @GeekAlf_Pro ,

Can you try like below  - 

 ClearCollect(
    TwoDistinctValue
First(Distinct(
        Filter(
            '[dbo].[QSE_DistinctLigneArr]';
            Value(cb_LgArret.Selected.ligne) = Value(ligne)
        );
        Text(SensA)
    )).Result
    );
    Collect(TwoDistinctValue,First(Distinct(
        Filter(
            '[dbo].[QSE_DistinctLigneArr]';
            Value(cb_LgArret.Selected.ligne) = Value(ligne)
        );
        Text(SensB)
    )).Result);

Hope to help you to resolve your Issue.
Thanks,

Hello,

 

@VijayTailor thanks for tour proposal, unfortunatly, i have the same result.

Hello @RandyHayes 

Thanks too for taking time with my issue

here are my details : 

 

1) What is SensA and SensB? I work in transportation, so for a given stop you have 2 directions, I try to retrieve them

2) What kind of column type is ligne?

3) What is the items property of cb_LgArret?

 

the datatype are as follows : 

 

2020-10-12 19_57_54-Window.png

@GeekAlf_Pro 

Perfect!  Thank you.

So, you have a lot of conversions - Text and Value in your formula, that you do not need.  All of the referenced columns are nvarchar.  So there is no conversion necessary.  This is almost ALWAYS the source of why things work differently on different devices.  One will convert differently and not give you what you want.

 

So, I rewound a little and considered that you said this collection is being used for the Items property of your ComboBox. SO, you might want to consider cutting the collection out of your app to lighten it up and reduce the maintenance overhead later by just putting this formula on the Items property of the ComboBox:

 

ForAll(Sequence(2);
    {Value:
        First(
            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';         
                    cb_LgArret.Selected.ligne = ligne
                );
                If(Value=1; SensA; SensB)
            )
        ).Result            
    }
)

 

That will give you a dynamic combobox with the 2 distinct values from the SensA and SensB columns without the need to refresh the collection over and over.

 

If you still want to maintain a collection instead of the dynamic results of above, then adjust your formula to the following:

 

ClearCollect(
    TwoDistinctValue;
        First(
            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';
                    cb_LgArret.Selected.ligne = ligne
                );
                SensA
            )
        ).Result;

        First(
            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';
                    cb_LgArret.Selected.ligne = ligne
                );
                SensB
            )
        ).Result
)

 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hello @RandyHayes 

 

i've set up the combo box like you said.

it works fine on my computer but... still not on devices...

so i decided to delete the previous combo et recreate it entirely

 

still the same behaviour......

it's crazy since my apps on devices are both up to date

@GeekAlf_Pro 

At this point I would try to start dialing back and picking apart the formula to determine where it is failing.

For example, is the Filter causing the issue?  To test, set the formula to this:

ForAll(Sequence(2), 
    {Value:
        First(
            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';         
                    cb_LgArret.Selected.ligne = "a known value"
                );
                If(Value=1; SensA; SensB)
            )
        ).Result            
    }
)

Notice the hard coded check of ligne.  Put one in that you know is there and see if the results change.

Still not a change, then consider taking the criteria out to test:

ForAll(Sequence(2), 
    {Value:
        First(
            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';         
                    true
                );
                If(Value=1; SensA; SensB)
            )
        ).Result            
    }
)

Still nothing?  Then consider the filter working and start picking apart other parts, like the Distinct.  Maybe take it out to test.

ForAll(Sequence(2), 
    {Value:
        First(
//            Distinct(
                Filter('[dbo].[QSE_DistinctLigneArr]';         
                    cb_LgArret.Selected.ligne = ligne
                )  //;
//                If(Value=1; SensA; SensB)
            )
        ).SensA  //.Result            
    }
)
// You'll have two of the same values, but this is just a test

 

And so on...just keep picking and testing.  I've been through MANY of the "works on design and desktop, but not on device" moments, and that is the series of steps that I usually take to resolve it.  Almost always it is an issue with a data type or conversion as the devices seem to handle that so much different - but I do say "almost always", not "always".

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

hi @RandyHayes 

 

thanks a lot for your advice and methodology !

I was looking for this kind of approach to debugging

 

for the moment i've tested all your suggests without success, unfortunatly.

still on the road 🙂

@GeekAlf_Pro 

Keep at it!  

Worse case, go all the way back to the root and just use the datasource on the control and see if that works by itself.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (41,941)