Powerapps - Change gallery source and patch destination - gallery

I'm about to go mad about an issue in Powerapp.
I'm making an app, which will be used to count inventory in different locations.
I'm using a gallery to show the data from my Excel spreadsheet, and it works fine, if I choose the locations in the gallery settings menu.
However, I would like the text input field in the gallery to show the current value, from the location which I enter in the top text input field. I would also like to have the correct column PATCH when I press the arrow.
Does anybody know how I can make it happen?
Thanks in advance!

To display the column based on the input box text, set the 'Default' formula of the gallery input boxes to be:
If(TextInput.Text = "Loc21", Loc21, TextInput.Text = "Loc22", Loc22, TextInput.Text = "Loc23", Loc23, TextInput.Text = "Loc24", Loc24, TextInput.Text = "Loc25", Loc25, TextInput.Text = "Loc26", Loc26)
You can't update tables from a static data source such as Excel. You could however upload your data to a SharePoint site or Common Data Service and then use a [Patch](https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch) function to update the value in that new data source.

Related

How can I make the file_get_contents run when I press the button

I am using codeneigter php for a website. There are inputs in a form file in the admin panel. I transfer data to variables with file_get contents on the backend to these imputs and print the data inside the inputs. Finally, I upload these data to my website in the form of a post. I want it to send the data in it to the filegetcontents function and write the incoming data into the input. I want the data inside the input to change whenever I want. When I press the key, the data in the input will be deleted and replaced with a new one.
BEFORE;
enter image description here
At the beginning there is such data. I print this data with a variable.
I'm talking about an input with a website link in it.
AFTER;
The data inside the input will turn into this when the key is pressed.
I'm talking about an input with a website link in it.
enter image description here

Using popup to select correct relational field and pass value back to an entry form

I am using Google App Maker with Cloud SQL to build an asset tracking database.
I have a couple tables with relations:
Asset List (Many to One with locations)
Locations (Many to One with Districts)
Districts (Many to One with Areas)
The issues is when populating new related location fields in an data entry form is that several districts may have locations with the same name. When using the standard drop down the same values appear and there is no way for the user to know which district the location is associated with.
Example: On the asset entry form drop down locations show:
- Shop
- Crew 1
- Crew 2
- Shop
- Crew 1
- External Vendor
I have 2 pages:
Assets - Datasource: Assets table
Entry form Datasource:inherited(assets) to enter new assets
Table View Datasource:Inherited(assets) to see asset that get entered )no edit)
Locations Pop-up
This seems to work as expected basically forms to navigate to correct Location and store it in a text box and a button with the On_Click property to send the textbox value to the data entry form on assets (not working) I can pass the value to a widget but can't figure out how to save it to the actual data source.
Currently using the location in the text box on this form should i be using Id?
I created a pop-up form which lets the user navigate to the correct location record ID by filtering on district. I am having trouble understanding how to actually write it back to the correct location field on the asset entry form. I am new to Java Script/Apps Script so the meaning of all the properties and how to use them is giving me trouble.
I tried setting a text box named SetLocation in the entry form and setting the value property to
#datasource.item.Location.Location
Then in the popup I set the button on_click to
app.pages.Assets.descendants.SetLocation.value =
widget.parent.descendants.PassLocation.value;
Pass Location is the name of the textbox on the popup where the correct location is stored.
Some suggestions to consider. In your popup set a dynamic property, call it 'CreateDatasource' or whatever suits your needs.
In your assets page form where you navigate to your popup (lets say it's a button that opens the popup from your form) put the following code:
var popup = app.popups.YourPopup;
popup.properties.CreateDatasource = widget.datasource;
popup.visible = true;
Lets say your popup content datasource is set to Locations, and your popup has some inputs that filter your locations and then there is a table that displays your filtered results. In this table you would select the appropriate location row and then your popup has a button that passes the location back to your asset form, with code like this:
widget.root.properties.CreateDatasource.item.Location = widget.datasource.item; //this would set the relation only assuming your asset relation end to locations is named 'Location'
widget.root.visible = false;
This would work assuming everything is set up correctly in your relations.

Dynamic Field in Form Grid (X++)

Currently I have a table which contains input from users, and these input will be shown in a Form.
The case is, I am able to show checkbox in the form manually but as the input from users grows, I need to have the checkbox to be generated automatically. Is there any way to achieve this in X++?
There no restriction whether the checkbox is lined horizontal or vertical, it's just it would be nice if it can be shown as columns.
I wanted to make the checkbox generated automatically so when Table_A have inputs, I don't need to insert a form manually.
This is so when I look at Stall 1, I know what menus it is selling.
As mentioned by FH-Inway, you need to create additional table e.g. Table_ATable_BRelation. Please find below code to add controls dynamically:
form = formRun.form();
design = form.design();
grpCtrl = design.addControl(FormControlType::Group, #GroupControl);
while select Table_A
{
idx++;
Table_ATable_BRelation = this.findOrCreateRelation(Table_A, Table_B);
chkBoxCtrl = grpCtrl.addControl(FormControlType::CheckBox, strFmt("CheckBox%1", Table_A.ID));
chkBoxCtrl.label(Table_A.Food_Menu);
chkBoxCtrl.labelPosition(LabelPosition::Above);
chkBoxCtrl.helpText(strFmt("your text here %1.", Table_A.Food_Menu));
chkBoxCtrl.value(Table_ATable_BRelation.IsSelling);
chkBoxCtrl.registerOverrideMethod(methodStr(FormCheckBoxControl, clicked),
methodStr(ClassHelper, checkBoxClicked),
this);
}
grpCtrl.columns(idx);

Lookup field appears as numerical values instead of text on Access report

I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!

How to Add Text Box to RDLC 2010 Report

I am a casual user of the RDLC report control in VS 2005 Web Application, it seemed straightforward. I could set a report data source, then just drag a field into the report body as a text box.
In VS 2010, dragging a field onto a report does not seem to work. I can drag a field into a cell in a table I've added to the report, but when I drag a field onto the report body, rather than show the field name in the text box, I see <> there.
In the expression box, the field looks like =First(Fields!state.Value, "TestDataSet"), but there is a squiggly red line under Field!stata, and no help to say what the problem is. The fields in the table right next to it seem OK. In the text box I can pick the field from a drop down, but I still get the error.
There is only one data set, containing one table connected to the report, so I don't see how there can be ambiguity or how the field could be out of scope..
It must be something simple.
Thanks
Mike Thomas
Assuming you are passing the correct dataset name (found in the report's Report Data tab if you aren't sure), be sure you are passing an IEnumerable (such as a List) as the data component of the ReportDataSource. If you are passing a single object instead of a list, be sure to wrap it in an anonymous array, like this:
ReportDataSource reportDataSource =
new ReportDataSource("TestDataSet", new[] { mySingleObject });

Resources