Using a hashtable to fill textbox in poweshell - hashtable

I created some Hash tables that will be used to fill text boxes. I want to access the Hash table with a variable that was selected from a list box.
$Dallas =#{
Address = "I20"
City = "Dallas"
State = "TX"
Zip = "75300"
}
I have a combo box with a list of city's
$myCity = $comboCity.Text
write-host $myCity "shows the city you selected"
I know that "$Dallas.Address" will show 120 but "$myCity.Address" is not a valid choice
My question is how do I make "$myCity" equal to the Hash table $Dallas?

Related

DT::datatable selecting a row + creating sentences based on data

I'm trying to use datatable function with DT, and below is what I have so far:
datatable(pr, rownames=FALSE, colnames=c('Percentile Rank','Grade','From','To'),
filter='top', option = list(pageLength=5, autoWidth=TRUE),
caption = htmltools::tags$caption(
style = 'caption-side: bottom; text-align: center;',
'Note: ', htmltools::em('___caption')
))
Instead of using the caption, I want it available for the users to select a specific row to have the description (i.e., "A did better than ____ % of their peers in grade ___.") depending on the row they select.
How can I add a checkbox or make it possible for the users to select a specific row to get the description?
How can I include a sentence created based on the data (e.g., using paste)?

Powerapps: Patch a record based on a text input control

I am wrestling with a simple patch function to update a record based off the value of an text input control. What I want is for PowerApps to update a record where a value in a table = the value in a text input field.
Table2 contains my data.
ID is unique for each row.
ProjID is the name of the text input control. This contains the value of ID that I want to update.
Current Phase is the column I want to update with the value in projID.
I have based the code below off some code which I use to create new records which works, so I think it is the lookup element that is not working.
Patch(
Table2,
lookup(Table2,Id = ProjID.Text ),
{
'Current Phase': CurrentPhase.Text,
}
)
)
Any help would be greatly appreciated!
The below should work and you can use comma either to add more conditions or data values
Patch( Table2,
First(Filter(Table2, ProjID.Text = Id ) )
, {
'Current Phase': CurrentPhase.Text
}
)

Dynamic Dropdown issue

Hello I am trying to implement a drop down in asp.net. The drop down is being loaded from database and is being binded with drop down. The list has various values and text. But I want to add the first option of "Please Select" which is disabled for selection at the top of drop down list. Also on binding the drop down I want to point to the value which user had previously selected so that's why I am using selectedValue option. the problem is if I add the first item as "please select" from code behind at item 0 and selectedvalue to the value stored in db it still shows me item zero" please select".
DropDownList ddlMinEdit = (DropDownList)currentGrid.Rows
[currentGrid.EditIndex].FindControl("ddlMinEdit");
ddlMinEdit.Items.Insert(0, "Select Please");
ddlMinEdit.Items [0].Attributes.Add("disabled", "disabled");
ddlMinEdit.DataSource = CList;
ddlMinEdit.DataTextField = "empid";
ddlMinEdit.DataValueField = "empname";
ddlMinEdit.DataBind();
ddlMinEdit.SelectedValue = defemp;
So any suggestion how do I add first item and at same time bind a list and point to selected value. thanks
The order that you are doing things doesn't seems correct. You should insert the "Select Please" after the data binding and setting the selected value:
DropDownList ddlMRCClinEdit = (DropDownList)currentGrid.Rows [currentGrid.EditIndex].FindControl("ddlMRCClinEdit");
ddlMRCClinEdit.DataSource = clinList;
ddlMRCClinEdit.DataTextField = "empid";
ddlMRCClinEdit.DataValueField = "empname";
ddlMRCClinEdit.DataBind();
ddlMRCClinEdit.SelectedValue = defemp;
ddlMRCClinEdit.Items.Insert(0, "Select Please");
ddlMRCClinEdit.Items [0].Attributes.Add("disabled", "disabled");

Form view (for Inserting only) - contains drop down list

I have a form view in ASP.NET with a text box and a drop down list.
I'm trying to populate the drop down list - from a separate table than the one I'm inserting data into. For example - a list of states - with Value = CA; Text = California.
I have a LINQ statement that I've created, but I can't seem to populate the ddl.
Any suggestions?
First of all return a list from your table:
myEntities dc = new myEntities();
List<MyTable> lst = (from ro in dc.MyTable select ro).ToList();
Than, add an object into your list (or insert into a position).
lst.Insert(0, new MyTable(){TextField = "California", ValueField = "CA"});
drp.DataSource = lst;
drp.DataBind();

PeopleSoftModifying field labels while keeping the column label

I have a grid where one column is a column of hyperlinks. How can I set the field labels to display the field's value, while keeping the column's label fixed?
You do this in two steps
set the Grid Column Label
For each row in the grid assign a value to the label of the field associated with the button
Ensure on the page that you have set the page field value for the grid and for the hyperlink column
The example below assumes the field associated with the hyperlink is SELECT_BTN. The column heading will be set to "My Column Title" and the hyperlink on the button will be set to the value of the DESCR field on same record.
Local Grid &grid;
Local GridColumn &hyperlinkColumn;
Local integer &i;
Local Rowset &rowset;
/* set the column header */
&grid = GetGrid(%Page, "MYRECORD");
&hyperlinkColumn = &grid.GetColumn("SELECT_BTN");
&hyperlinkColumn.Label = "My Column Title";
&rowset = GetLevel0()(1).GetRowset(Scroll.SOMERECORD);
/* Set the value for each hyperlink in the rowset */
For &i = 1 To &rowset.ActiveRowCount
&rowset(&i).SOMERECORD.SELECT_BTN.Label = &rowset(&i).SOMERECORD.DESCR.Value;
End-For;

Resources