I was trying an MVC 5 edit code with a file upload. I want to update my details except my image. But when I did the coding and tried it, my image field updated to 'null'. How to solve this else condition where no image was selected? i.e., I don't want to update my image, but other fields.
If you use sql and update image path in sql then write down like this.
UPDATE
tblName
SET
Colname=#param,
ImageColumn = ISNULL(#paramimg,ImageColumn)
Where id =#Id
Related
I am mostly new to PowerApps but I am creating a stand-alone app that uses Power Automate to upload records to a SharePoint library. I have that working, and on one of the forms I have search functionality so that the gallery is filtered by the value in a few text boxes.
What I want to do is on the form where they upload new records, I want to look up to see if metadata already exists and eventually populate text boxes with the information from those records. Right now I am using a button with this code in the OnSelect event to just find how many records exist with that project number:
Set(varCount, CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )))
I also tried this.
If(CountRows(Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )) > 0, Set(varCount, 1), Set(varCount,2))
I am getting a warning about large datasets only. However, when I try to run it nothing happens. When I look at the monitor details I get this error first:
"The query is not valid.\r\nclientRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f\r\nserviceRequestId: 816f2bfb-ab50-4285-b9c9-a7e03548d15f"
Then this one:
"Error when trying to retrieve data from the network"
The connection works when I am filtering a gallery, but not when I'm trying to use the count. Does anyone have any idea what is happening?
Thanks!
I'm not sure, but I suspect that there's an error in your Filter. The second argument should result in a logical true/false (include the record or not). Yours looks to resolve to a string.
Filter(ProjectDocuments,'txtProj#'.Text, ProjNum )
I think you mean
Filter(ProjectDocuments,'txtProj#'.Text = ProjNum )
Wondering if you could help with this problem please. I am ingesting data from an API using Azure logic App. I have managed to set up everything else but struggling with pagination in Until condition.Logic App continues to ingest/consume data and creates blank json files with data[]. I have added the screenshots (with and without data in the page). When data is completed, empty or blank page looks like data[].
Any idea what could be my condition in "Until" ?
enter image description here
In your question I can't see the "Until" condition but just a "If" condition, but I think you just want to know how to check if the "data" field is empty and then do different actions (If I misunderstand your requirements, please provide more details and I will try to help you on it).
Please refer to the steps below:
1. We need to use a "Parse JSON" action to parse your json data, when click "Use sample payload to generate schema", you can put the json data which "data" field is not empty into it. And then it will generate the schema automatically.
2. Then we can use "length()" method in the "If" condition.
The whole expression of "length()" method above is:
Below provide the code for you to copy.
length(body('Parse_JSON')?['data'])
Hope it helps~
I'm using Kentico MVC v12 with a fresh installation of DancingGoat(MVC) template.
I've modified the "E-commerce" module by adding a new column in the "Order" table.
I would like to be able to see it on the "Order" module in the list page.
I see in the "User interface" tab that it uses an "aspx" page.
In it I see that it calls an "ascx" page that uses a "UniGrid" component and specify the columns directly in a data attribute.
I don't like the idea to modify this file to display my new column because I see this website as the foundation of my next features, I would like to avoid as much as possible to touch the code of the website template, do you know if there is an other way ?
Maybe I'm missing a configuration somewhere else ?
Thank you by advance !
Update 06-03-2019:
I tried the solution of Peter Mogilnitski but it doesn't work :x
I added the column in the data source
Then I checked the column in widget configuration
Nothing is displayed
I debugged the sql query, I don't see my column in the query, is there an other configuration to do somewhere else ?
Update 08-03-2019:
The support of Kentico confirmed that the solution I proposed that was confirmed by #Rui was the right way to do it.
Thank you everyone !
If you want the custom field to appear in the UI, you will have to make change to the ascx page. You will need to make a note to that because you will likely need to update it during upgrade or hotfix (less likely)
Other than adding the data field to Columns, you will also need to add ug:column to the section
<ug:Column Name="SAPID" Source="SAPID" Caption="SAPID" Sort="SAPID" />
Yes. There is. This is the widget called orders:
You need to go to widgets, select orders widget and add your column to visible columns
Now go to store overview:
Click on properties of latest orders (this is orders widget used all over the store) and scroll down to column and make your column checked.
In a traditional notes form, I want to compute an image dynamically. Image is in another database's image resource in the same server.
I have tried using pass thru HTML by computing the URL in computed text. Its working fine in web. But I need to show the form in Notes Client. I am using the client version 8.5.2.
In computing URL I have tried using notes:// instead of http://. Still no luck.
If anybody help me to find out.
Thanks in advance.
It appears the computed image resource doesn't like implied text construction, I tried to do exactly as you building the image string and it kept failing until I did this:
#Text(#GetField("from") + ".jpg")
I used a combo box "from" to test with "refresh on keyword change" to simulate a new value. The images changed beautifully and the resource was selected from a different database.
One thing to watch for, that I was unaware of, is if you create an image resource and import a .bmp (bitmap) image, it's changed to an .jpg. This could mess you up by trying to reference a non existing image.
In short, a computed image resource from a different database will work.
While inserting image resource you can select the database from which the image needs to be loaded. So when you go to "Create > Image Resource" you can select "Database" field and then the images in that database.
All you need to do is insert an image resource. Place your cursor on the form where you want the dynamic picture, right mouse click and select "insert resource". Once the "Insert Recource" dialog displays select the database where the image resources are stored and the select the "Images" Resource type. You will have to select an image, probably make it your default image and click "OK".
Next, click on the image to give it focus and then either do an "alt + Enter" or right click and select "Picture Properties". When the picture properties display you'll see at the far right of the "Source" field two icons, select the second "#" for the formula window, this is where the magic is done. You'll see the current image name is already there. All you do now is create your #If statements to change the image name, no paths just the image name, the resource is already tied to the database where your images are stored. This has been long but actually implementing is quick and simple. enjoy:-)
Karthick,
I'm not sure if this is your issue but remember the order of how your form is processed, left to right and top down. If the field with your empcode is positiond after the image resource, the formula won't see the field value, unless you do a refresh. I used a field that contained the value to check to switch my images and that worked. Have you tried #GetField("the field name") to return the value?
You can not do it in direct way. You can neither compute the database nor pass the other db's image url. When inserting resource, it will ask for database name. if you choose the name as "a". Then the image resource will adopt to the database what you have chosen. It will take the images from the db "a". It will not take the image from current DB. So you just pass the image file name simply.
Use formula like this.,
#If(#GetField("pic")="1";"spinning earth.gif";#GetField("pic") = "3";"logo.jpg";"attach2.jpg")
The mentioned three picture is coming from different database but same server. If you want to fetch the image from current db then use another image resource. Make hide when. squeeze your brian.
The computed image resource as described in the other solutions will for sure work.
The only "problem" is, that the designer wants to get a text pointing to a valid file when saving the form. Otherwise it will render the image unusable.
Knowing that and knowing, that field- values are considered empty in the designer client, you have to "wrap" your result in an if- clause, or break out of computation, if the needed field is empty. Your first line could look like:
#If( FieldWithImageName = ""; #Return( "myfallbackimage.jpg" ); "" );
After that you do your computation. designer will fallback to the fallback- image, and the client will compute the image based on your formula, if the field that you refer to is above the image (you know: left to right, top to bottom computation of forms)
Another thing to notice: in earlier versions of Lotus Notes the image just scaled to its own 100% size, when you seleced 100% in the image properties. But in 7 (iirc) this changed, and all images are displayed with the number of pixels the image in designer was stored. If your fallback- image is 100x100 pixels, then every image will be squeezed or stretched to that extends. So better be sure, all images have the same size.
Is it possible to add a custom field to modx_site_content? What I'm trying to accomplish, is to add a field t_id. I've already added this in the database. However, when I save it using: $object->save(); nothing is saved for that field, it just comes up as Null.
The version I'm using is: MODX Revolution 2.2.4-pl (June 14, 2012)
Actually - I've answered that question before. You want to create a separate table and schema.
modx evolution external database
however - it looks like you want to add a field so that you can call it as part of the page/template in modx? You may have to write a plugin to extract that data at the same time as the resource.
I know this is an old topic, but now the ClassExtender extra will create the additional table for you based on your schema, add the additional fields to the Create/Edit Resource panel with a plugin, and save those field values to the table in the DB when the Resource is saved in the Manager. This can save a lot of time and trouble.
If you can wait, a new version that works in MODX 3 should be released soon.