PySide6 prevent repeating single line slot for multiple connections - connection

I'm coming to you for some Pyside6 expertise:
I need a form to enter name, email, tel... of colleagues. I used a QFormLayout by adding 4 rows title-Qlineedit and 2 rows title-Qcombobox.
I want to get the values entered in the lineedit and combobox and put them into a dictionary {'name': value1, 'email': value2...}
I have to repeat the same connection for the 4 lineedit to a slot which contains only one line but which changes according to the lineedit in question like this:
lineedit_xxx.editionFinished(returnPressed).connect(methode1)
lineedit_yyy.editionFinished(returnPressed).connect(method2)
I find this redundant and I tried with partial and lambda but without success:
with lambda I tried this form "lambda lineedit_xxx.text(): dict['name'] = le_xxx.text()" but it seems "illegal".
with partial I couldn't manage the change of lineedit (le_xxx, le_yyyy,...).
Is there a simple way to write only one method that captures all cases?
thank you all for your help

Related

Zapier form dynamic inputFields manipulation

I'd like to manipulate the input fields of a trigger form dynamically:
I have a trigger 'hidden' with a combo-box in a form
Each time I update the combo, it should add one or more combo-boxes in the same form depending on the value
I couldn't find any way to access the operation.inputFields somewhere for doing an update on this list dynamically, whether via the bundle or else...
Here is the small example: https://github.com/nuxeo-sandbox/nuxeo-zapier/blob/spikes-NXP-26085-zapier/nuxeo-zapier-app/triggers/project.js#L8-L16
Thank you for your help!
Vlad
David here, from the Zapier Platform team.
It sounds like you're looking for Custom Fields: https://github.com/zapier/zapier-platform-cli#customdynamic-fields
In addition to a static list of input fields, you can provide a function that will run and provide a dynamic set of fields. It's how we get inputs for each column in a google sheet:
Is that what you're asking? Modifying the inputFields array at runtime probably doesn't do what you want.

How to disable caching of select2 search results?

I have two select2 containers, which work together side-by-side. Both are ajax based selects, and the selected value of one of them, determines the results in the other.
My problem is the following: when I select the first of the two select boxes, and open up the second one, it is prepopulated with the correct search results. Yet, when I change the first select, and then reopen the second one, for a split-second, while the ajax request is sent for the new data from the second select option, the results that were shown previously are still visible and selectable.
For a concrete example, imagine the following two select boxes: one is for occupation, and the other contains names of persons. The intended use case would be, is to select an occupation in the first one, and then the second one will only list the persons with that occupation. If I select, for example doctor as the occupation, and then list the second one with all the doctors I get the correct result. But if I then reselect the first one, and change it to engineer, and re-open the second one, I will get the list of doctors for a split-second, before the ajax manages the load my engineers. I can even select a doctor, as an engineer, if I am quick enough.
Is there a way to disable this behaviour? IE: whenever I click on an ajax related select2, show me an empty list, or the "Searching" string, while the request to the server is made, and an answer is returned?
Select2 "caches" options retrieved by ajax inside the options of the original tag. To disable cache as you say, remove all those options just before the new option gets selected.
In practice, removing options before or after does not make a difference in your problem, but if you were to have this same problem in a single select (not combining two as you mention), you should do this with the event 'select2:selecting', instead of 'select2:select' event (Select2 events)
$('#select-occupation').select2({
...,
ajax: {
...
}
})
.on('select2:selecting', function(event){
console.log('actual value: ' + $(event.target).val());
$('#select-people').find('option').remove();
});

Bringing in a google form response to a sheet

Here is a copy of the sheets and form (form > go to live)
https://docs.google.com/a/ncsu.edu/spreadsheets/d/1mEz9mLEgP4Cfts2ZU6NwhNiL6xjWdFbt42RUj-RYbZw/edit?usp=sharing
So currently, I get responses in a different sheet. Ideally, I would get the response on the tracking sheet with the appropriate format for the dates. Additionally, I would like to keep the functionality of the tracking sheet which is to be able add in items by hand and not through the form. I currently have a script in place which auto-inputs the current date as the two separate formats.
So I'm looking for a solution which either takes in form response to the sheet and appropriate cells (the first empty cell). Or I'm looking to create a script which onEdit which when the form sheet is edited, will fetch the new response and copy it over appropriately onto the tacking sheet.
I have tried googling answers.. But I think I may be a failure at it since I wasn't able to really find a solution for this particular problem. Thank you in advance for the help!
form:
https://docs.google.com/forms/d/1AHSQrLkq3U7NJMvgWoH3lAygova7Mi4BaXHdROaaS2g/edit?usp=sharing
The script associated to this form should do the trick.
All the explanations on how to use it are in the response sheet

run SPD workflow on changes to any field EXCEPT one?

I have a custom list. Each item in the list has 39 fields/columns that need to be filled out and a 40th field that gets filled out by a separate workflow.
I have another workflow that I need to trigger if any of the fields change EXCEPT for one.
Why? Because that field has a custom ID# in it and that field gets populated AFTER the form is submitted. Therefore, there will ALWAYS be a change in the list item. Thus, I need a workflow to trigger when any fields change EXCEPT the one w/ the custom ID#.
Any ideas? Thank you.
No one has been able to answer this but I figured it out myself.
I'm including the answer here in case anyone else ever comes across this and finds it helpful:
Create a new field that you will hide from the your SP list and from NewForm.aspx, EditForm.aspx, and DispForm.aspx.
Using jQuery, populate that hidden field as such: $(":input[Title='fieldName']").val("1");
The using an SPD workflow, check to see if that field = 1. If so, run the workflow. AND at the end of that workflow set the field to 0 - that's important.

Access 2010 form not displaying query

I'm sure this is an easy fix but I can't seem to find it. I just have a form, that will be a subform of another, that needs to display the results of a query.
The query is simple enough, just displays all fields of records that fall between specified dates. The query works great, but when I attach it to the form as its record source it doesn't display the data. I can see the correct amount of record selectors so I know its understanding the query but its as if all fields are hidden!
I have also tried building a query to the forms record source that was simply Select query.* From query. Oddly I have had this working before but I had to specify every field. What I mean is:
Select title From query
Select type From query
Select date From query
...
And so on for all the fields but this seems foolish, can anyone think of what I may be doing wrong?
Thanks in advance!
Edit, forgot to mention I also tried the foolish solution that I mentioned above and it didn't work so its definitely some issue that I'm not seeing, some property that's probably not appropriately set
#sshekhar well its not really code at the moment I'm using Access 2010. I have a form that needs to display a subform that executes this query of displaying records that have a data field that fall between dates specified by the user. The query works and displays the correct records, but the form that it is attached to only shows the record selectors and all the fields appear to be "hidden." I thought it may be one of the form's properties set incorrectly but I checked on the test form from another database that I used and each have what appears to be identical settings. So I'm at a loss!
So it turns out even though I using a query that holds all the fields it will not display the content unless you go to the Add Existing Fields and add all the the fields you want to see. This seems really silly especially when the results in the query but at least its working now.
I had this problem and discovered that having the property DataEntry set to YES will only display new records. From Microsoft Help:
You can use the DataEntry property to specify whether a bound form
opens to allow data entry only. The Data Entry property doesn't
determine whether records can be added; it only determines whether
existing records are displayed. Read/write Boolean.

Resources