PowerApps: Filter by user no delegation - delegation

Need some help with PowerApps - I am trying to filter the gallery where the Person column (ROMEmail) equals the logged in user.
This code is working, but the blue circle of death comes up - whilst in test at the moment, i dont have over 500 records, but will do within a month of trialling this
Any ideas on how to workaround this? Using a collection or variable perhaps? I haven't really used these yet so a detailed resolution would be greatly appreciated.
SortByColumns(Filter('Reviews', StartsWith(LocationName, TextSearchBox1.Text),ROMEmail.Email = User().Email), "Modified", If(SortDescending1, Descending, Ascending))

A collection would be your best choice.
To add a collection in your app replace the code where you grab your data by something like this:
ClearCollect(localData,'Reviews')
This collects all the data in a locally collection. The ClearCollect replaces all your data by the new ones.
After this you can sort and filter directly on your collection. For example in a gallery. Using your code it would look like this:
SortByColumns(Filter(localData, StartsWith(LocationName, TextSearchBox1.Text),ROMEmail.Email = User().Email), "Modified", If(SortDescending1, Descending, Ascending))

Related

Graphene-Django possible to filter a set?

newly working with GraphQl and wondering is it possible to filter a set in a query? I'm still new to database design as well so could be an issue there.
So I run the below query, managerGwPicks has a field player with is a player object containig their name etc.
This player object contains a set of all the weeks they have played which is a separate table in my database.
So as can be seen in the above image when I display the set it shows all the gameweek data whereas ideally I would like it filtered by the gameweek:21 parameter passed to the managerGwPicks query.
I'm not sure it should be possible as there is no direct link between the managerGwPicks and playergwstats tables but I'd like to be sure that my thinking is correct.
My solution for my front end would be to have two queries, one similar to what I have getting the player information and a second query using the player id and gameweek to query playergwstats to get the player stats for the individual week. Does this sound like a reasonable approach?
It's preferable to avoid query patterns where you have to do multiple back-and-forths between the client and the server. If you can imagine making the link on the client then you can do it directly on the server. If you can go from a managerId and gameweek to a list of players and you can go from players to playergwstats then you can create a join that goes from your two parameters to all the relevant players.
I've covered patterns like this in a series of posts on GraphQL for SQL Developers - look at the join that's used to go from a booking reference to a series of tickets and flights.

Superset partion graph type order by

We are creating several charts in superset and with the partition type chart the ORDER BY seems to be hard coded and we cannot change it. The goal is too have the months on the left in the correct order (the column in this case is Month). When run in sql lab it works in correct order but in the chart view we cannot change the ordering
Any suggestions?
I assume you mean the dates on the right here?
I work with superset and I have experienced this limitation that does appear to be hard-coded into the ordering once a chart is made. I would suggest if it wasn't too much hassle to add another column to your database of the text value and follow the patter of;
WHERE "Month" = 'January' SET "OrderingColumn" = 'A'
WHERE "Month" = 'February' SET "OrderingColumn" = 'B'
etc etc
Then in your charts you can try: ORDER BY "OrderingColumn"
It is a bit of an inconvenience but if you are able to manipulate your data by changing tables or views this seems to be a solution you could use.
I hope this may be useful even to change the way of approaching the problem.

Mapping user spreadsheet columns to database fields

I’m not sure where to start on this project. I know how to read the contents of the excel spreadsheet, I know how to identify the header row, I know how to loop over the contents. I believe I have the UX portion worked out but I am not sure how to process the data.
I’ve googled and only found .Net solutions but I’m looking for a ColdFusion/Lucee solution.
I have a working form allowing me to map a user's spreasheet column to my database values (this is being kept simple for this post; user does not have direct access to the database).
Now that I have my data, I'm not sure how to loop over the data results. I believe there will be several loops (an outer and an inner). Then of course I also need to loop over the file contents but I think if I can get the headings mapped out,I can figure out the remaining.
Any good links, tutorials, or guides would be greatly appreciated.
Some pseudo code might be enough to get me started.
User uploads form
System reads headers and content.
User is presented form with a list of columns from their uploaded spreadsheet to match with available database fields (eg “column1” matches “customer name”.
User submits form.
Now what?
UPDATED
Here is what the data looks like AFTER the mapping has been done in my form. The column deliiter is the ::: and within the column the ||| indicates the ID associated with the selected column value. I've included the id and the column value since I plan on displaying the mapping again as a confirmation. Having the ID saves a trip to the database.
If I understand correctly, your question is: how do you provide the user a form allowing them to map their spreadsheet columns to that of the database
Since you have their spreadsheet column names, and you have the database column names, then this problem is essentially a UI/UX problem. You need to show both lists, and allow the user to map them. I can imagine several approaches to this. My first thought would be some sort of drag/drop operation, as follows:
Create a list of boxes, one for each field in your database table, and include the field name in (or above) the box. I'll call this the db field list. Then, create another list for each column from the spreadsheet, which I'll call the spreadsheet column list. The user would drag/drop items from the spreadsheet column list to the db field list.
When a mapping has been completed by the user, you would store the column/field names in as data for the DOM element of the db field list box. Then upon submission, you would acquire the mapping data by visiting each box and adding it to an array. Then you would serialize that array into JSON and send that to your form submission handler.
This could be difficult or easy, depending on your knowledge of UI implementations using JavaScript. jQuery makes this easy (if you know jQuery). There's even a jquery UI plugin that does this: https://jqueryui.com/droppable/.
A quick search for javascript drag drop would help, and here's a few articles I found:
https://www.w3schools.com/html/html5_draganddrop.asp
https://medium.com/quick-code/simple-javascript-drag-drop-d044d8c5bed5
You would also need to submit the array of mappings using javascript. You could search for that as well, and here's an article I found:
https://codereview.stackexchange.com/questions/94493/submit-an-array-as-an-html-form-value-using-javascript

Django Inline with join table structure

So I have a DB structure like so: (ignore how i named things its a quick fake DB example things)
Collection: id, ...
List: id, title,...
Car: id, name, ...
CollectionHasList: id, collectionid, listid
ListHasCar: id, carid, listid
So what I am trying to do is in the django admin panel under collection/add I want to be able to fill in all of these tables instead of filling everything in individually one by one.
So the collection fields will exist as normal, but then I want to have a custom field that takes in a list title and a text area that takes in a comma delimited cardIds (cards are already created and don't need to be done through here, just list and collections) But since Collections have many lists, I want to be able to click a "add" button and generate the same custom form again to add more lists (with associated cars).
I think in the model I will be able to do the custom saving that I need, but I can't get the form to work and thats what I need most help on. Can anyone please help me! Thank you so much! I looked everyone on stack overflow and haven't found anything that can directly help me, some good points, but I still can't put it together.

How do you get child bands in ultragrid without using related tables in a dataset?

I'm using linq to pull back an object (i.e. customer) that might have a collection of other objects(customer.orders). I would be nice if I can pass this list of customers to the ultragrid and a hierarchical view of customers and thier orders displayed on databind. When I try this, I just get customers. Anyone know how to get this to work with non dataset objects?
Figured it out. IList collection works and will create bands for properties of your domain object if it is an IList<T>. Just make sure thatDisplayLayout.ViewStyle = ViewStyle.MultiBand.
I've tried the following and it didn't work:
DisplayLayout.ViewStyle = ViewStyle.MultiBand
I read from this blog that it must be List and not IList in order to work, and it did.
We work with our own custom datasource for grid, so we first create a structure of bands and then we initialize data OnDemand, handling events
InitializeDataRow
InitializeRowsCollection
CellDataRequested
We use Tags to navigate through the structure.